//
//  LoanCaculateUtil.h
//  LoanCalculate
//
//  Created by 冷悦 on 16/3/29.
//  Copyright © 2016年 冷悦. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, LoanCalculateType){
    AverageCapital, //等额本金
    AverageCapitalPlusInterest //等额本息
};

@interface LoanCalculateUtil : NSObject

/**
 *  房产总额(精确到万元)
 */
@property (nonatomic, assign) CGFloat houseTotalPrice;

/**
 *  优惠率(换算成小数（比如0.3）)
 */
@property (nonatomic, assign) CGFloat discountRatio;

/**
 *  首付比例(如果3成，输入0.3)
 */
@property (nonatomic, assign) CGFloat firstPaymentRatio;

/**
 *  还款期数
 */
@property (nonatomic, assign) NSUInteger period;

/**
 *  需支付总额(只是指去除优惠后需要客户支付的总价格，不包括贷款)
 */
@property (nonatomic, assign) CGFloat amount;

/**
 *  月利率
 */
@property (nonatomic, assign) CGFloat ratio;

/**
 *  贷款类型, 等额本金， 等额本息
 */
@property (nonatomic, assign) LoanCalculateType loanCalculateType;



/**
 *  首付金额（精确到万元）
 */
@property (nonatomic, assign, readonly) CGFloat firstPayment;

/**
 *  贷款总额（精确到万元）
 */
@property (nonatomic, assign, readonly) CGFloat loanTotalMoney;

/**
 *  贷款利息（精确到万元）
 */
@property (nonatomic, assign, readonly) CGFloat totalInterest;

/**
 *  优惠钱数（精确到万元）
 */
@property (nonatomic, assign, readonly) CGFloat disccountMoney;

/**
 *  总还款额
 */
@property (nonatomic, assign, readonly) CGFloat totalRepayment;

/**
 *  月均还款
 */
@property (nonatomic, assign, readonly) NSInteger averagePayMoneyPerMonth;

/**
 *  每月还款明细，tableView使用
 */
@property (nonatomic, strong, readonly) NSArray *paymentInfos;

/**
 *  计算贷款
 */
- (void)calculate;
@end
